#include <QApplication>

#include "DGVLatticeVTK.h"
#include "DGVDiophantineVTK.h"

const int dimension = 2;
const int windowSize = 512;

int main(int argc, char *argv[])
{
	QApplication app(argc,argv);
	DGVLatticeVTK lattice, latticeAsMatrix;
	DGVDiophantineVTK line, line2;

    ///Create Lattice (default dimension is 2) and display
    Array<latticeType,1> parameters(dimension);

    ///Set Parameters
    parameters = 5, 10;
    lattice.setLatticeParameters(parameters);
    parameters = 10, 10;
    latticeAsMatrix.setLatticeParameters(parameters);

    ///Create lattice
    lattice.setLatticeColour(0,0,0);
    lattice.generateLattice();
    lattice.setLatticePointColour(2,1,256,256,256);
    lattice.resize(windowSize,windowSize);
	lattice.show();

	latticeAsMatrix.generateLattice();
    latticeAsMatrix.viewAsMatrix();
    latticeAsMatrix.resize(windowSize,windowSize);
    latticeAsMatrix.enableAxes();
    latticeAsMatrix.show();

    ///Setup line and display
    ///Set line parameters
    ///Create and draw line on lattice given by slope and point
	line.setLattice(&lattice);
	line.setCoefficients(1,1,0);
	line.setPointOnLine(2,1,0);
	line.setColour(0,0,0); //Black
	line.generateLine();

	line2.setLattice(&latticeAsMatrix);
	line2.setCoefficients(2,1,0);
	line2.setPointOnLine(0,1,0);
	line2.setColour(0,0,0); //Black
	line2.generateLine();

	return app.exec();
}

